<?php

$username = $_POST['username'];
$password = $_POST['password'];

include("opendb.php");
include("functions.php");
$res = isValidUser($username,$password);
if($res!=1) {
echo "$username = $password";
exit;
}

$First_Name = $_POST['First_Name'];
$Last_Name = $_POST['Last_Name'];
$MLS_Agent_ID = $_POST['MLS_Agent_ID'];
$License_Number= $_POST['License_Number'];
$Service = $_POST['Service'];
$Email= $_POST['Email'];
$Business_Name = $_POST['Business_Name'];
$Street = $_POST['Street'];
$address2 = $_POST['address2'];
$City = $_POST['City'];
$State = $_POST['State'];
$Zip = $_POST['Zip'];
$Office_Phone = $_POST['Office_Phone'];
$Primary_Contact_Phone = $_POST['Primary_Contact_Phone'];
$Toll_Free_Number = $_POST['Toll_Free_Number'];
$Fax = $_POST['Fax'];
$Pager = $_POST['Pager'];
$Home_Phone = $_POST['Home_Phone'];
$Website = $_POST['Website'];
$Phone = $_POST['Phone'];



$uquery = "update Users set ";
$uquery.= " First_Name ='".  $First_Name."',";
$uquery.= " Last_Name ='".  $Last_Name."',";
$uquery.= " MLS_Agent_ID ='".  $MLS_Agent_ID."',";
$uquery.= " License_Number='".  $License_Number."',";
$uquery.= " Service ='".  $Service."',";
$uquery.= " Email='".  $Email."',";
$uquery.= " Business_Name ='".  $Business_Name."',";
$uquery.= " Street ='".  $Street."',";
$uquery.= " address_2 ='".  $address2."',";
$uquery.= " City ='".  $City."',";
$uquery.= " State ='".  $State."',";
$uquery.= " Zip ='".  $Zip."',";
$uquery.= " Office_Phone ='".  $Office_Phone."',";
$uquery.= " Primary_Contact_Phone ='".  $Primary_Contact_Phone."',";
$uquery.= " Toll_Free_Number ='".  $Toll_Free_Number."',";
$uquery.= " Fax ='".  $Fax."',";
$uquery.= " Pager ='".  $Pager."',";
$uquery.= " Home_Phone ='".  $Home_Phone."',";
$uquery.= " Website ='".  $Website."',";
$uquery.= " Phone ='".  $Phone."'";
$uquery.= " where Username='".$username."'";



$result = mysql_query($uquery) or die ("SQL Error".mysql_error());	

echo "1";



?>